<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>
<script>

    function fun1() {
        var data = [];

        return {
            add: function (obj) {
                data.push(obj);
            },
            remove: function () {
                data.shift()  //删除第一个元素
            },
            getData: function () {
                return data;
            }
        }
    }

    var fn = fun1();
    fn.add([6,4,8,1]);  //增加了数组
    console.log(fn.getData());
    
    // fn.remove(1);
    // console.log(fn.getData());
    
        
  







</script>

</html>